package com.hll.spring.aop;

import com.hll.spring.aop.aopanno.User;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author hll
 * @create 2022-05-11 12:26
 */
public class SpringTest {
  private final ApplicationContext context =
      new AnnotationConfigApplicationContext(ConfigAop.class);

  @Test
  public void test1() {
    User user = context.getBean("user", User.class);
    user.add();

    /*
        PersonProxy Before.........
    UserProxy环绕之前.........
    UserProxy before.........
    add.......
    UserProxy afterReturning.........
     UserProxy after.........
    UserProxy环绕之后.........
         */
  }
}
